﻿using System;
using System.Collections.Generic;
 
using SiteUnity.Layers.Core.Provider;
using SiteUnity.Layers.Entity.General;
using SiteUnity.Layers.Entity.PageItems.Files;
using SiteUnity.Layers.Core.Provider.PageItems;
using SiteUnity.Frame.Common.Tools.Data;

namespace SiteUnity.Layers.Application.Files
{
    public class FileManager
    {
        static private FileProvider _fileprovider = new FileProvider();

        static public List<File> getFileByPage(Page page)
        {
            return _fileprovider.selectFileByPage(page);
        }

        static public List<FileType> FileType
        {
            get
            {
                List<FileType> filetypes;

                Cache.AddIfNotExists("FileType", out filetypes, _fileprovider, "selectFileType", null);

                return filetypes;
            }
        }
    }
}
